home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
progjour
/
1991
/
06
/
alib
/
alib.doc
< prev
next >
Wrap
Text File
|
1991-08-23
|
12KB
|
713 lines
;; abort if cf
;
; entry Cf error flag, program exits if set (Cf==1)
;; add atom
;
; entry DS:SI string to hash
; exit AX atom index
; Cf if table full
;; add binary atom
;
; entry DS:SI bytes to hash
; CX byte count (<256)
; exit AX atom index
; Cf if table full or atom too big
;; block alloc
;
; exit AX block size in bytes
; BX block handle
; ES:DI block pointer
; Cf if no memory
;; block file open
;
; entry DS:SI file name
; exit AX file size in blocks
; BX block handle
; Cf if file not found or empty
;; block file read
;
; entry AX 16k file block number (0..n)
; BX block index
; exit DS:SI block pointer
; AX block size (<16k if last block)
; Cf if bad block index or past end of file
;; block free
;
; entry BX block index
; exit Cf if bad index (cannot free file blocks)
; uses AX,BX
;; block read
;
; entry BX block index
; exit AX block size
; DS:SI block pointer
; Cf if bad block or no memory
;; calloc
;
; entry CX requested byte count (1..FFF0)
; exit AX actual byte count
; ES:DI storage pointer
; Cf if no storage
;; check block file
;
; entry DS:SI file name
; exit BX file id or 0 if unknown file
;; clear ncb
;
; entry DS:SI ncb ptr
;; clear strerror
;
; zeros error string pointer
;; close file
;
; entry BX handle
; exit Cf if error
; uses AX
;; close file cf
;
; entry BX handle
; Cf error flag
; exit Cf if error flag set on entry or error during close file
; uses AX
;; current file size
;
; entry BX file handle
; exit DX AX file size
; Cf if unexpected file error
;; dialog error beta
;
; entry AX DGROUP error string
; exit Cf 1
; uses AX
;; dialog strerror beta
;
; exit Cf 1
; uses AX
;; disable exit intercept
;
; uses AX,SI,DS
;; ems exchange
;
; entry AX page index (1..n)
; ES:DI destination
; exit Cf if bad block or EMS error
; uses AX
;; ems in
;
; entry AX block index (1..n)
; ES:DI destination (no transfer if NULL)
; exit Cf if bad block or EMS error
; uses AX
;; ems out
;
; entry ES:DI source
; exit AX block index (1..n)
; Cf if EMS full or EMS error
;; enable exit intercept
;
; uses AX,SI,DS
;; err disk full
;
; exit Cf 1
; uses AX
;; exit
;
; entry AL exit code
;; exit with failure
;; exit with success
;; fatal app exit
;
; entry AX offset of DGROUP error string
; note this function never returns
;; fclose
;
; entry BX stream handle
; exit Cf if error closing file or bad handle
; uses AX,BX
;; find atom
;
; entry DS:SI string to find
; exit AX atom index
; Cf if not found
;; find binary atom
;
; entry DS:SI bytes to hash
; CX byte count (<256)
; exit AX atom index (or 0)
; Cf if not found
;; fopen
;
; entry AX mode, 'r' or 'w' to open for reading or writing
; DS:SI filename
; exit BX stream handle
; Cf if error
; uses AX
;; fread
;
; entry BX stream handle
; CX byte count
; ES:DI destination pointer
; exit AX actual byte count (!=CX for EOF)
; DI updated
; Cf if error
;; free
;
; entry ES:DI storage pointer (OK if NULL)
; exit ES:DI NULL
; Cf if bad pointer
; uses AX
;; fwrite
;
; entry BX stream handle
; CX byte count
; DS:SI source pointer
; exit AX bytes written
; SI updated
; Cf if error
;; get atom name
;
; entry AX atom index
; CX buffer size
; ES:DI output buffer
; exit DI updated (points to \0)
; CX updated
; Cf if bad atom index
; uses AX
;; get input state
;
; exit Zf if no key waiting
; uses AX
; note returns TRUE for keyboard, mouse, and timer under Windows
;; get strerror
;
; exit DS:SI error string
; Zf if no error string
;; get vector
;
; entry AL vector #
; exit DS:SI selected vector
; Zf if null vector
; uses AX
;; global alloc
;
; entry CX requested size
; exit AX actual size
; BX storage handle (never zero)
; Cf if no storage
;; global calloc
;
; entry CX requested size
; exit AX actual size
; BX storage handle (never zero)
; Cf if no storage
;; global free
;
; entry BX storage handle (OK if zero)
; exit BX 0
; uses AX
;; global lock
;
; entry BX valid storage handle
; exit DS:SI storage pointer
; note DOES NOT BASH AX
;; global realloc
;
; entry BX storage handle
; CX new size
; exit AX actual size (if no errors)
; Cf if not enough memory
;; global unlock
;
; entry BX valid storage handle
; note flags do NOT change
;; init atom table
;
; entry AX prime number approximate twice maximum atom count
; exit Cf if no memory
; uses AX
;; input file size
;
; entry BX file handle
; exit DX AX size
;; isalnum
;
; entry AL character
; exit Zf if alphanumeric character
;; isalpha
;
; entry AL character
; exit Zf if AL==A-Za-z
;; isalpha_
;
; entry AL character
; exit Zf if AL alphabetic or _ but not number
;; iscntrl
;
; entry AL character
; exit Zf if control character (0x7F or 0x00..0x1F)
;; isdigit
;
; entry AL char
; exit Zf if 0..9
;; isgraph
;
; entry AL character
; exit Zf if printable character (not space)
;; islower
;
; entry AL character
; exit Zf if a..z
;; isprint
;
; entry AL character
; exit Zf if printable character (including space)
;; ispunct
;
; entry AL character
; exit Zf if !"#%&'();<=>?[\]*+,-./:^_{|}~
;; isspace
;
; entry AL character
; exit Zf if space, FF, NL, CR, HT, or VT
;; isupper
;
; entry AL character
; exit Zf if A..Z
;; isxdigit
;
; entry AL character
; exit Zf if 0..9 A..F a..f
;; malloc
;
; entry CX requested byte count (1..FFF0)
; exit AX actual byte count
; ES:DI storage pointer (unchanged if error)
; Cf if no storage
;; move file pointer
;
; entry BX file handle
; DX AX file position
; exit Cf if error
; uses AX
;; ms dos
;; ms dos dialog
;
; entry * according to dos function
; exit *
; uses *
; note displays dialog box when ms_dos returns an error
;; ms dos strerror
;; netbios add name
;
; entry DS:SI asciiz name (less than 16 characters long)
; exit Cf if error
; AL name number (or return code if error)
;; netbios call
;
; entry DS:SI netbios control block
; exit AX return code (0xFF if function pending)
; Cf if error
;; netbios cancel
;
; entry DS:SI netbios command block
; exit AX final return code
; Cf if error
;; netbios check
;
; exit Cf if no netbios driver
; uses AX,SI
;; netbios delete name
;
; entry DS:SI asciiz name (less than 16 characters long)
; exit Cf if error
; AL return code
;; netbios hang up
;
; entry AL session number
; exit AL return code
; Cf if error
;; netbios receive wait
;
; entry AL local session number
; CX buffer length
; ES:DI buffer pointer
; exit AL return code
; CX bytes received (0 if session closed or error)
; Cf if error (session closed is not an error)
;; netbios send broadcast
;
; entry AL add name number
; CX buffer length
; ES:DI buffer
; exit AL return code
; Cf if error
; note waits until datagram sent over network
;; netbios send datagram
;
; entry AL add name number
; CX buffer length
; ES:DI buffer
; DS:SI asciiz call name (destination)
; exit AL return code
; Cf if error
; note waits until datagram sent over network
;; netbios send wait
;
; entry AL session number
; CX length
; ES:DI buffer pointer
; exit AL return code
; Cf if error
;; open block file
;
; entry DS:SI file name
; exit CX file size in 16k blocks
; DX file id (1..n)
; Cf if file not found or no storage
; uses AX
;; open input file
;
; entry DS:SI string
; exit AX,BX handle
; Cf if error, error text set
; calls offset_dos_error, ms_dos
;; open output file
;
; entry DS:SI string
; exit AX,BX handle
; Cf if error, error text set
; calls offset_dos_error, ms_dos
;; perror
;
; entry DS:SI optional message prefix
; uses AX
;; put hex byte
;
; entry AL byte
; uses AX
; note calls putchar to write chrs
;; put hex word
;
; entry AX word
; uses AX
;; put multiple bytes
;
; entry CX byte count
; DS:SI byte pointer
; uses AX,CX,SI
;; put netbios name
;
; entry DS:SI name field of control block
; uses AX,SI
;; put string
;
; entry DS:SI asciiz string
; uses AX
;; put unsigned
;
; entry AX number
; uses AX
;; putchar
;
; entry AL character
;; putchar newline
;
; uses AX
;; putchar space
;
; uses AX
;; puts
;
; entry DS:SI asciiz string
; uses AX
;; puts dgroup
;
; entry AX DGROUP string pointer
; uses AX
;; rand
;
; exit AX random number
;; random
;
; entry AX num
; exit AX random number between 0 and num-1
;; read block file
;
; entry AX file block index (0..n)
; BX file id (1..n)
; ES:DI transfer address
; exit AX byte count
; Cf if error
;; read command line
;
; exit DS:SI program command line
;; read entire file
;
; entry DS:SI asciiz file name
; exit DS:SI ptr to storage containing file (NULL delimited)
; CX file byte count
; Cf if file not found or too big
; uses AX
;; read environment
;
; exit DS:SI environment
;; read from file
;
; entry BX file handle
; CX byte count
; ES:DI destination
; exit AX number of bytes read
; Cf if error
;; realloc
;
; entry CX requested byte count (1..FFF0)
; ES:DI storage pointer
; exit AX actual byte count
; Cf if not enough memory or cannot increase size
;; remove
;
; entry DS:SI filename to delete
; exit Cf if error
; uses AX
;; rename
;
; entry DS:SI old name
; ES:DI new name
; exit Cf if error
; uses AX
;; rewind
;
; entry BX file handle
; exit Cf if error
; uses AX
;; save most
;
; note saves all registers except AX and BP. however, the current
; version also saves BP because the code works out that way.
; the registers are automatically restored. this routine is
; called with a return address as the top of stack.
;; select min count
;
; entry CX count1
; DX AX count2
; exit CX minimum of count1 and count2
;; set argc argv
;
; exit Cf if no memory
; uses AX,CX,DI,SI,ES,DS
;; set block handle
;
; entry BX block handle
; DX file id
; exit Cf if bad file id
; uses AX,CX,SI,DS
;; set strerror
;
; entry AX DGROUP offset of asciiz error string
; exit Cf 1
;; startup
;
; entry AX offset stack
; ES program segment prefix
; SS DGROUP
; exit BP 0
; may use AX,BX,CX,DX,DI,SI,DS,ES
;; strcmpi
;
; entry DS:SI string1
; ES:DI string2
; exit Zf if string1==string2
; uses AX
;; strcpy
;
; entry DS:SI source ptr
; ES:DI destination ptr
; exit SI updated past NULL
; DI updated, points to NULL
; uses AX
;; strcpy limit
;
; entry DS:SI source pointer
; ES:DI destination pointer
; DX destination limit
; exit DI updated to last character in destination
; uses AX
;; strlen
;
; entry DS:SI string
; exit CX byte count excluding NULL
; uses AX
;; strlenz
;
; entry DS:SI string
; exit CX byte count including NULL
; uses AX
;; strncpy
;
; entry DS:SI source string
; ES:DI destination buffer
; CX byte count (includes room for \0)
; exit SI updated (past \0 unless CX too small)
; DI updated (points to \0)
; CX updated
; uses AX
;; strskp
;
; entry DS:SI asciiz string ptr
; exit SI updated past null
; uses AX
;; strskp line
;
; entry DS:SI string pointer
; exit SI updated to next line but not past \0
; AL delimiting char (either 0 or 0Ah)
;; strskp white
;
; entry DS:SI text ptr
; exit SI updated past spaces and tabs
; AL non-white character
;; swap in
;
; entry AX swap index
; ES:DI destination (no disk I/O if NULL)
; exit Cf if error
; uses AX
;; swap out
;
; entry ES:DI source pointer
; exit AX swap index (1..MAX) or 0 if error
; Cf if error (full disk or swap file, not DOS 3+)
;; tolower
;
; entry AL char
; exit AL lower cased AL
;; toupper
;
; entry AL char
; exit AL upper cased AL
;; write to file
;
; entry BX file handle
; CX byte count
; ES:DI buffer
; exit Cf if error